with Ada.Text_Io; use Ada.Text_Io;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;

procedure Tasques1 is

  task type T(C: Character; Voltes: Positive);

  task body T is
    N: Integer := 1;
  begin
    for I in 1..Voltes loop
      Put(C); Put(N, Width => 0); Put(" ");
      N := N + 1;
    end loop;
  end T;

  Num_Voltes: Positive;

begin
  Put("Quantes voltes? ");
  Get(Num_Voltes);
  declare
    A: T('A', Num_Voltes);
    B: T('B', Num_Voltes);
  begin
    Put_Line("Jo soc el main!");
  end;
  Put_Line("Ja esta!");
end Tasques1;
